package com.digitalchina.lxnsy.viewholder;

import android.text.TextUtils;
import android.view.ViewGroup;
import android.widget.TextView;

import com.digitalchina.lxnsy.R;
import com.digitalchina.lxnsy.entity.HQDetailsVO;
import com.digitalchina.lxnsy.toolkit.DateStyle;
import com.digitalchina.lxnsy.toolkit.DateUtil;
import com.jude.easyrecyclerview.adapter.BaseViewHolder;

/**
 * ================================================
 * 项目名称：BigData
 * 类描述：
 * 包名：com.digitalchina.bigdata.viewholder
 * 创建人：郑皓
 * 创建时间：2017/3/2 20:00
 * 修改备注：
 * ================================================
 */
public class HelpAndSupportHolder extends BaseViewHolder<HQDetailsVO> {

    private TextView tvIssue;
    private TextView tvExpertName;
    private TextView tvDate;

    public HelpAndSupportHolder(ViewGroup parent) {
        super(parent, R.layout.item_help_and_support);
        tvIssue = $(R.id.item_help_tv_issue);
        tvExpertName = $(R.id.item_help_tv_expert_name);
        tvDate = $(R.id.item_help_tv_date);
    }

    @Override
    public void setData(HQDetailsVO data) {
        super.setData(data);
        tvIssue.setText(TextUtils.isEmpty(data.getContent()) ? "" : data.getContent());
        tvExpertName.setText(TextUtils.isEmpty(data.getExpertName()) ? "" : data.getExpertName());
        tvDate.setText(TextUtils.isEmpty(data.getStartTime()) ? "" : DateUtil.StringToString(data.getStartTime(), DateStyle.YYYY_MM_DD_EN));
    }
}
